<?php
/**
 * Created by PhpStorm.
 * User: zxy
 * Date: 2018/2/28
 * Time: 15:12
 */


include_once  'DaoBase.class.php';
class CodeDao extends DaoBase
{
    protected $table_name = "code";

    public function isExistUser($codeId){
        $filed = array(
            'user_id'
        );
        $where = array('code_id = ' => $codeId);
        return  sizeof($this->select($filed,$where));
    }

    public function inserCode($codeId){
        $filed = array(
            'user_id'
        );
        $data1["id"] = uniqid();
        $data["user_id"] = $id;
        $data["code_id"] = $_POST["codeId"];
        $where = array('code_id = ' => $codeId);
        return  sizeof($this->select($filed,$where));
    }

}

/*$a = new CodeDao();
$a->isExistUser(123);*/